﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace ArticleWeb
{
    public static class RequestExtension
    {
        public const int PageSize = 15;
        public static int GetPageIndex(this HttpRequestBase request)
        {
            if (request["page"] == null)
                return 1;
            return int.Parse(request["page"]);
        }

        public static int GetPageSize(this HttpRequestBase request)
        {
            if (request["size"] == null)
                return PageSize;
            return int.Parse(request["size"]);
        }
    }
}